package controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import service.ProductService;
import util.CommonResult;

@RestController
public class ProductController {
    @Autowired
    private ProductService productService;

    @GetMapping("/getAllProductById")
        public CommonResult getAllProductById(@RequestParam("id") Integer id) {
        return productService.getAllProductById(id);
    }
    @GetMapping("/getAllProduct")
    public CommonResult getAllProduct() {
        return productService.getAllProduct();
    }
}
